import { createApp } from 'vue';
import App from './App.vue';
import router from './router';
import { store, key } from './store';
import { directive } from '/@/utils/directive';
import { i18n } from '/@/i18n/index';
import { globalComponentSize } from '/@/utils/commonFunction';

import ElementPlus from 'element-plus';
import 'element-plus/dist/index.css';
import '/@/theme/index.scss';
import 'font-awesome/css/font-awesome.min.css';
import mitt from 'mitt';
import screenShort from 'vue-web-screen-shot';
import VueGridLayout from 'vue-grid-layout';
import JsonViewer from 'vue3-json-viewer';
import "vue3-json-viewer/dist/index.css";

import * as svg from '@element-plus/icons-vue';
import SvgIcon from '/@/components/svgIcon/index.vue';

const app = createApp(App);
app.use(router)
	.use(store, key)
	.use(ElementPlus, { i18n: i18n.global.t, size: globalComponentSize })
	.use(i18n)
	.use(screenShort, { enableWebRtc: false })
	.use(VueGridLayout)
	.use(JsonViewer)
	.mount('#app');

app.config.globalProperties.mittBus = mitt();

directive(app);

const icons = svg as any;
for (let i in icons) {
	app.component(`ele-${icons[i].name}`, icons[i]);
}
app.component('SvgIcon', SvgIcon);

